package com.crazy.crazytransactionservice.controller;

import com.crazy.crazycommon.common.BaseResponse;
import com.crazy.crazycommon.common.ResultUtils;
import com.crazy.crazymodel.model.dto.position.PositionRequest;
import com.crazy.crazymodel.model.vo.PageBankCardAndShareVO;
import com.crazy.crazytransactionservice.service.PositionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/transaction")
@Slf4j
public class PositionController {
    @Autowired
    PositionService positionService;

    /**
     * 获取用户持仓的 产品信息以及  用了哪些银行卡申购和对应的份额信息。
     * @return
     */
    @PostMapping("/position/getproducts")
    public BaseResponse<PageBankCardAndShareVO> getProductsPosition(@RequestBody PositionRequest positionRequest){
        PageBankCardAndShareVO productPositonVOList=positionService.getProductsPosition(positionRequest.getCustomerID(),positionRequest.getCurrent());
        return ResultUtils.success(productPositonVOList);
}
}
